<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

<ui:define name="head">
    <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
    <script type="text/javascript" language="javascript">
        document.onkeydown = function TabReplace() {
            if (event.keyCode == 13) {
                if (event.srcElement.tagName != 'BUTTON')
                    event.keyCode = 9;
                else
                    event.srcElement.click();
            }
        }
    </script>
    <style type="text/css">
        .img {
            width: 20px;
            height: 30px;
        }

        .c_c {
            background: gray;
        }
    </style>
</ui:define>
<ui:define name="content">
<div style="margin:5px;">
<h:form id="form">
<p:growl id="msgs" showDetail="true"/>
<p:panel id="ppCondition" header="分包合同阶段工程量结算" style="width: 100%">
    <h:panelGrid columns="2" cellspacing="3" style="width: 100%">
        <h:panelGrid id="pgCondition">
            <h:panelGrid columns="7">
                <h:outputLabel value="分包合同：" for="subcttPkid" style="font-weight: bold"/>
                <p:selectOneMenu id="subcttPkid"
                                 value="#{itemHieRelapCSubStlQPeriodForQueryAction.strSubcttPkid}">
                    <f:selectItems value="#{itemHieRelapCSubStlQPeriodForQueryAction.subcttList}"/>
                </p:selectOneMenu>
                <h:outputLabel value="开始期数：" for="startPeriodNo" style="font-weight: bold"/>
                <p:inputText id="startPeriodNo" value="#{itemHieRelapCSubStlQPeriodForQueryAction.strStartPeriodNo}"
                             onclick="WdatePicker({dateFmt:'yyyyMM'})">
                    <p:ajax event="blur" update="msgs"
                            listener="#{itemHieRelapCSubStlQPeriodForQueryAction.blurPeriodNo()}"/>
                </p:inputText>
                <h:outputLabel value="结束期数：" for="endPeriodNo" style="font-weight: bold"/>
                <p:inputText id="endPeriodNo" value="#{itemHieRelapCSubStlQPeriodForQueryAction.strEndPeriodNo}"
                             onclick="WdatePicker({dateFmt:'yyyyMM'})">
                    <p:ajax event="blur" update="msgs"
                            listener="#{itemHieRelapCSubStlQPeriodForQueryAction.blurPeriodNo()}"/>
                </p:inputText>
            </h:panelGrid>
        </h:panelGrid>
        <h:panelGrid columns="2" style="width:10%">
            <p:commandButton id="qryBtn" value="查询"
                             action="#{itemHieRelapCSubStlQPeriodForQueryAction.onQueryAction()}"
                             style="width:90px"
                             update="pdt,msgs">
            </p:commandButton>
            <p:commandButton id="resetBtn" value="重置"
                             action="#{itemHieRelapCSubStlQPeriodForQueryAction.reSetAction()}"
                             style="width:90px"
                             update="ppCondition,msgs">
            </p:commandButton>
        </h:panelGrid>
    </h:panelGrid>
</p:panel>

<p:ajaxStatus style="width:16px;height:16px;">
    <f:facet name="start">
        <h:graphicImage value="/images/ajaxloading.gif"/>
    </f:facet>
    <f:facet name="complete">
        <h:outputText value=""/>
    </f:facet>
</p:ajaxStatus>

<p:dataTable id="pdt" style="width:100%;"
             value="#{itemHieRelapCSubStlQPeriodForQueryAction.itemOfCSStlQPeriodForQueryList}"
             var="record"
             rowKey="#{record.strPkid}"
             selectionMode="single"
             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
             paginator="true"
             paginatorPosition="bottom"
             rows="50"
             rowsPerPageTemplate="200,100,50,40,30,20,10"
             rowIndexVar="row"
             emptyMessage="数据记录为空..."
             widgetVar="dtItemDetail"
             rowStyleClass="#{record.bdSignPartAPrice eq 0?null:'c_c'}">

<!--<p:columnGroup type="header">
    <p:row>
        <p:column headerText="序号" rowspan="2"/>
        <p:column headerText="分包合同" colspan="4" />
        <p:column headerText="分包结算" colspan="1"/>
    </p:row>

    <p:row>
        <p:column headerText="编号"/>
        <p:column headerText="项目名称"/>
        <p:column headerText="单位"/>
        <p:column headerText="工程量"/>

        <p:column headerText="开累工程数量"/>
    </p:row>
</p:columnGroup>-->

<p:column style="width:20px" headerText="序号">
    <h:outputText value="#{row + 1}"/>
</p:column>

<p:column style="width:100px" headerText="编号">
    <h:outputText value="#{record.strNo}" escape="false"/>
</p:column>
<p:column style="width:150px" headerText="项目名称">
    <h:outputText value="#{record.strName}"/>
</p:column>

<p:column style="width:30px" headerText="单位">
    <h:outputText value="#{record.strUnit}"/>
</p:column>

<p:column style="width:80px" headerText="对应合同清单工程数量">
    <h:outputText value="#{record.bdContractQuantity}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px" headerText="开累工程数量">
    <h:outputText value="#{record.bdBeginToCurrentPeriodEQty}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(0).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(0).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty0}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(1).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(1).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty1}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(2).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(2).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty2}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(3).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(3).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty3}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(4).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(4).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty4}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(5).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(5).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty5}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(6).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(6).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty6}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(7).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(7).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty7}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(8).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(8).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty8}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(9).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(9).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty9}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(10).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(10).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty10}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(11).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(11).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty11}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(12).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(12).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty12}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(13).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(13).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty13}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(14).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(14).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty14}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(15).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(15).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty15}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(16).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(16).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty16}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(17).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(17).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty17}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(18).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(18).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty18}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(19).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(19).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty19}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(20).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(20).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty20}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(21).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(21).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty21}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(22).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(22).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty22}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<p:column style="width:80px"
          headerText="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(23).header}"
          rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.columnSetList.get(23).rendered_flag}">
    <h:outputText value="#{record.bdCurrentPeriodEQty23}" style="float: right">
        <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
    </h:outputText>
</p:column>

<!--<p:columns value="#{itemHieRelapCSStlQPeriodForQueryAction.esItemStlSubcttEngQPeriodList}"
           var="column"
           columnIndexVar="colIndex">
    <f:facet name="header">
        #{column.header}
    </f:facet>
    #{column.property}
</p:columns>-->

<f:facet name="footer">
    <div style="text-align: left">
        <p:commandButton value="导出到EXCEL"
                         action="#{itemHieRelapCSubStlQPeriodForQueryAction.onExportExcel}"
                         ajax="false"
                         rendered="#{itemHieRelapCSubStlQPeriodForQueryAction.strExportToExcelRendered}">
        </p:commandButton>
    </div>
</f:facet>
</p:dataTable>
</h:form>
</div>
</ui:define>

</ui:composition>